package b.g.b.h;

/* compiled from: Barrier */
public class a extends h {
    public int n0 = 0;
    public boolean o0 = true;
    public int p0 = 0;
    public boolean q0 = false;

    public boolean A() {
        return this.q0;
    }

    public boolean Q() {
        d dVar;
        int i;
        b.g.b.h.c.a aVar = b.g.b.h.c.a.BOTTOM;
        b.g.b.h.c.a aVar2 = b.g.b.h.c.a.TOP;
        b.g.b.h.c.a aVar3 = b.g.b.h.c.a.RIGHT;
        b.g.b.h.c.a aVar4 = b.g.b.h.c.a.LEFT;
        int i2 = 0;
        int i3 = 0;
        Object obj = 1;
        while (true) {
            int i4 = this.m0;
            if (i3 >= i4) {
                break;
            }
            dVar = this.l0[i3];
            if (this.o0 || dVar.e()) {
                i = this.n0;
                if (!(i == 0 || i == 1) || dVar.z()) {
                    i = this.n0;
                    if (i != 2) {
                        if (i != 3) {
                        }
                    }
                    if (dVar.A()) {
                    }
                }
                obj = null;
            }
            i3++;
        }
        if (obj == null || i4 <= 0) {
            return false;
        }
        i3 = 0;
        obj = null;
        while (i2 < this.m0) {
            dVar = this.l0[i2];
            if (this.o0 || dVar.e()) {
                if (obj == null) {
                    int i5 = this.n0;
                    if (i5 == 0) {
                        i3 = dVar.i(aVar4).c();
                    } else if (i5 == 1) {
                        i3 = dVar.i(aVar3).c();
                    } else if (i5 == 2) {
                        i3 = dVar.i(aVar2).c();
                    } else if (i5 == 3) {
                        i3 = dVar.i(aVar).c();
                    }
                    obj = 1;
                }
                i = this.n0;
                if (i == 0) {
                    i3 = Math.min(i3, dVar.i(aVar4).c());
                } else if (i == 1) {
                    i3 = Math.max(i3, dVar.i(aVar3).c());
                } else if (i == 2) {
                    i3 = Math.min(i3, dVar.i(aVar2).c());
                } else if (i == 3) {
                    i3 = Math.max(i3, dVar.i(aVar).c());
                }
            }
            i2++;
        }
        i3 += this.p0;
        int i6 = this.n0;
        if (i6 == 0 || i6 == 1) {
            F(i3, i3);
        } else {
            G(i3, i3);
        }
        this.q0 = true;
        return true;
    }

    public int R() {
        int i = this.n0;
        if (i == 0 || i == 1) {
            return 0;
        }
        return (i == 2 || i == 3) ? 1 : -1;
    }

    /* JADX WARNING: Removed duplicated region for block: B:75:0x00ff  */
    /* JADX WARNING: Removed duplicated region for block: B:79:0x0105  */
    /* JADX WARNING: Removed duplicated region for block: B:98:0x01a3  */
    /* JADX WARNING: Removed duplicated region for block: B:97:0x017c  */
    public void d(b.g.b.d r14, boolean r15) {
        /*
        r13 = this;
        r15 = b.g.b.h.d.a.MATCH_CONSTRAINT;
        r0 = r13.L;
        r1 = r13.D;
        r2 = 0;
        r0[r2] = r1;
        r1 = r13.E;
        r3 = 2;
        r0[r3] = r1;
        r1 = r13.F;
        r4 = 1;
        r0[r4] = r1;
        r1 = r13.G;
        r5 = 3;
        r0[r5] = r1;
        r0 = 0;
    L_0x0019:
        r1 = r13.L;
        r6 = r1.length;
        if (r0 >= r6) goto L_0x002b;
    L_0x001e:
        r6 = r1[r0];
        r1 = r1[r0];
        r1 = r14.l(r1);
        r6.i = r1;
        r0 = r0 + 1;
        goto L_0x0019;
    L_0x002b:
        r0 = r13.n0;
        if (r0 < 0) goto L_0x021a;
    L_0x002f:
        r6 = 4;
        if (r0 >= r6) goto L_0x021a;
    L_0x0032:
        r0 = r1[r0];
        r1 = r13.q0;
        if (r1 != 0) goto L_0x003b;
    L_0x0038:
        r13.Q();
    L_0x003b:
        r1 = r13.q0;
        if (r1 == 0) goto L_0x0072;
    L_0x003f:
        r13.q0 = r2;
        r15 = r13.n0;
        if (r15 == 0) goto L_0x005f;
    L_0x0045:
        if (r15 != r4) goto L_0x0048;
    L_0x0047:
        goto L_0x005f;
    L_0x0048:
        if (r15 == r3) goto L_0x004c;
    L_0x004a:
        if (r15 != r5) goto L_0x0071;
    L_0x004c:
        r15 = r13.E;
        r15 = r15.i;
        r0 = r13.V;
        r14.e(r15, r0);
        r15 = r13.G;
        r15 = r15.i;
        r0 = r13.V;
        r14.e(r15, r0);
        goto L_0x0071;
    L_0x005f:
        r15 = r13.D;
        r15 = r15.i;
        r0 = r13.U;
        r14.e(r15, r0);
        r15 = r13.F;
        r15 = r15.i;
        r0 = r13.U;
        r14.e(r15, r0);
    L_0x0071:
        return;
    L_0x0072:
        r1 = 0;
    L_0x0073:
        r7 = r13.m0;
        if (r1 >= r7) goto L_0x00bc;
    L_0x0077:
        r7 = r13.l0;
        r7 = r7[r1];
        r8 = r13.o0;
        if (r8 != 0) goto L_0x0086;
    L_0x007f:
        r8 = r7.e();
        if (r8 != 0) goto L_0x0086;
    L_0x0085:
        goto L_0x00b9;
    L_0x0086:
        r8 = r13.n0;
        if (r8 == 0) goto L_0x008c;
    L_0x008a:
        if (r8 != r4) goto L_0x00a0;
    L_0x008c:
        r8 = r7.m();
        if (r8 != r15) goto L_0x00a0;
    L_0x0092:
        r8 = r7.D;
        r8 = r8.f;
        if (r8 == 0) goto L_0x00a0;
    L_0x0098:
        r8 = r7.F;
        r8 = r8.f;
        if (r8 == 0) goto L_0x00a0;
    L_0x009e:
        r15 = 1;
        goto L_0x00bd;
    L_0x00a0:
        r8 = r13.n0;
        if (r8 == r3) goto L_0x00a6;
    L_0x00a4:
        if (r8 != r5) goto L_0x00b9;
    L_0x00a6:
        r8 = r7.q();
        if (r8 != r15) goto L_0x00b9;
    L_0x00ac:
        r8 = r7.E;
        r8 = r8.f;
        if (r8 == 0) goto L_0x00b9;
    L_0x00b2:
        r7 = r7.G;
        r7 = r7.f;
        if (r7 == 0) goto L_0x00b9;
    L_0x00b8:
        goto L_0x009e;
    L_0x00b9:
        r1 = r1 + 1;
        goto L_0x0073;
    L_0x00bc:
        r15 = 0;
    L_0x00bd:
        r1 = r13.D;
        r1 = r1.e();
        if (r1 != 0) goto L_0x00d0;
    L_0x00c5:
        r1 = r13.F;
        r1 = r1.e();
        if (r1 == 0) goto L_0x00ce;
    L_0x00cd:
        goto L_0x00d0;
    L_0x00ce:
        r1 = 0;
        goto L_0x00d1;
    L_0x00d0:
        r1 = 1;
    L_0x00d1:
        r7 = r13.E;
        r7 = r7.e();
        if (r7 != 0) goto L_0x00e4;
    L_0x00d9:
        r7 = r13.G;
        r7 = r7.e();
        if (r7 == 0) goto L_0x00e2;
    L_0x00e1:
        goto L_0x00e4;
    L_0x00e2:
        r7 = 0;
        goto L_0x00e5;
    L_0x00e4:
        r7 = 1;
    L_0x00e5:
        if (r15 != 0) goto L_0x00fb;
    L_0x00e7:
        r15 = r13.n0;
        if (r15 != 0) goto L_0x00ed;
    L_0x00eb:
        if (r1 != 0) goto L_0x00f9;
    L_0x00ed:
        if (r15 != r3) goto L_0x00f1;
    L_0x00ef:
        if (r7 != 0) goto L_0x00f9;
    L_0x00f1:
        if (r15 != r4) goto L_0x00f5;
    L_0x00f3:
        if (r1 != 0) goto L_0x00f9;
    L_0x00f5:
        if (r15 != r5) goto L_0x00fb;
    L_0x00f7:
        if (r7 == 0) goto L_0x00fb;
    L_0x00f9:
        r15 = 1;
        goto L_0x00fc;
    L_0x00fb:
        r15 = 0;
    L_0x00fc:
        r1 = 5;
        if (r15 != 0) goto L_0x0100;
    L_0x00ff:
        r1 = 4;
    L_0x0100:
        r15 = 0;
    L_0x0101:
        r7 = r13.m0;
        if (r15 >= r7) goto L_0x0176;
    L_0x0105:
        r7 = r13.l0;
        r7 = r7[r15];
        r8 = r13.o0;
        if (r8 != 0) goto L_0x0114;
    L_0x010d:
        r8 = r7.e();
        if (r8 != 0) goto L_0x0114;
    L_0x0113:
        goto L_0x0173;
    L_0x0114:
        r8 = r7.L;
        r9 = r13.n0;
        r8 = r8[r9];
        r8 = r14.l(r8);
        r7 = r7.L;
        r9 = r13.n0;
        r10 = r7[r9];
        r10.i = r8;
        r10 = r7[r9];
        r10 = r10.f;
        if (r10 == 0) goto L_0x013a;
    L_0x012c:
        r10 = r7[r9];
        r10 = r10.f;
        r10 = r10.d;
        if (r10 != r13) goto L_0x013a;
    L_0x0134:
        r7 = r7[r9];
        r7 = r7.g;
        r7 = r7 + r2;
        goto L_0x013b;
    L_0x013a:
        r7 = 0;
    L_0x013b:
        if (r9 == 0) goto L_0x0156;
    L_0x013d:
        if (r9 != r3) goto L_0x0140;
    L_0x013f:
        goto L_0x0156;
    L_0x0140:
        r9 = r0.i;
        r10 = r13.p0;
        r10 = r10 + r7;
        r11 = r14.m();
        r12 = r14.n();
        r12.d = r2;
        r11.e(r9, r8, r12, r10);
        r14.c(r11);
        goto L_0x016b;
    L_0x0156:
        r9 = r0.i;
        r10 = r13.p0;
        r10 = r10 - r7;
        r11 = r14.m();
        r12 = r14.n();
        r12.d = r2;
        r11.f(r9, r8, r12, r10);
        r14.c(r11);
    L_0x016b:
        r9 = r0.i;
        r10 = r13.p0;
        r10 = r10 + r7;
        r14.d(r9, r8, r10, r1);
    L_0x0173:
        r15 = r15 + 1;
        goto L_0x0101;
    L_0x0176:
        r15 = r13.n0;
        r0 = 8;
        if (r15 != 0) goto L_0x01a3;
    L_0x017c:
        r15 = r13.F;
        r15 = r15.i;
        r1 = r13.D;
        r1 = r1.i;
        r14.d(r15, r1, r2, r0);
        r15 = r13.D;
        r15 = r15.i;
        r0 = r13.P;
        r0 = r0.F;
        r0 = r0.i;
        r14.d(r15, r0, r2, r6);
        r15 = r13.D;
        r15 = r15.i;
        r0 = r13.P;
        r0 = r0.D;
        r0 = r0.i;
        r14.d(r15, r0, r2, r2);
        goto L_0x021a;
    L_0x01a3:
        if (r15 != r4) goto L_0x01cb;
    L_0x01a5:
        r15 = r13.D;
        r15 = r15.i;
        r1 = r13.F;
        r1 = r1.i;
        r14.d(r15, r1, r2, r0);
        r15 = r13.D;
        r15 = r15.i;
        r0 = r13.P;
        r0 = r0.D;
        r0 = r0.i;
        r14.d(r15, r0, r2, r6);
        r15 = r13.D;
        r15 = r15.i;
        r0 = r13.P;
        r0 = r0.F;
        r0 = r0.i;
        r14.d(r15, r0, r2, r2);
        goto L_0x021a;
    L_0x01cb:
        if (r15 != r3) goto L_0x01f3;
    L_0x01cd:
        r15 = r13.G;
        r15 = r15.i;
        r1 = r13.E;
        r1 = r1.i;
        r14.d(r15, r1, r2, r0);
        r15 = r13.E;
        r15 = r15.i;
        r0 = r13.P;
        r0 = r0.G;
        r0 = r0.i;
        r14.d(r15, r0, r2, r6);
        r15 = r13.E;
        r15 = r15.i;
        r0 = r13.P;
        r0 = r0.E;
        r0 = r0.i;
        r14.d(r15, r0, r2, r2);
        goto L_0x021a;
    L_0x01f3:
        if (r15 != r5) goto L_0x021a;
    L_0x01f5:
        r15 = r13.E;
        r15 = r15.i;
        r1 = r13.G;
        r1 = r1.i;
        r14.d(r15, r1, r2, r0);
        r15 = r13.E;
        r15 = r15.i;
        r0 = r13.P;
        r0 = r0.E;
        r0 = r0.i;
        r14.d(r15, r0, r2, r6);
        r15 = r13.E;
        r15 = r15.i;
        r0 = r13.P;
        r0 = r0.G;
        r0 = r0.i;
        r14.d(r15, r0, r2, r2);
    L_0x021a:
        return;
        */
        throw new UnsupportedOperationException("Method not decompiled: b.g.b.h.a.d(b.g.b.d, boolean):void");
    }

    public boolean e() {
        return true;
    }

    public String toString() {
        String d = c.b.a.a.a.d(c.b.a.a.a.g("[Barrier] "), this.d0, " {");
        for (int i = 0; i < this.m0; i++) {
            d dVar = this.l0[i];
            if (i > 0) {
                d = c.b.a.a.a.D(d, ", ");
            }
            StringBuilder g = c.b.a.a.a.g(d);
            g.append(dVar.d0);
            d = g.toString();
        }
        return c.b.a.a.a.D(d, "}");
    }

    public boolean z() {
        return this.q0;
    }
}
